<template>
  <div class="custom-table">
    <el-table
      :data="tableData"
      style="width: 100%"
      border
      :header-cell-style="{ textAlign: 'center' }"
      :cell-style="{ textAlign: 'center' }"
      :height="500"
      ref="table"
    >
      <el-table-column type="selection" width="55"> </el-table-column>
      <el-table-column prop="waybillNo" label="运单号" width="150">
      </el-table-column>
      <el-table-column prop="status" label="状态" width="150">
      </el-table-column>
      <el-table-column prop="model" label="型号" width="150"> </el-table-column>
      <el-table-column prop="brand" label="品牌" width="150"> </el-table-column>
      <el-table-column prop="number" label="数量" width="150">
      </el-table-column>
      <el-table-column prop="batch" label="批次" width="150"> </el-table-column>
      <el-table-column prop="package" label="封装" width="150">
      </el-table-column>
      <el-table-column prop="currency" label="币种" width="150">
      </el-table-column>
      <el-table-column prop="price" label="单价" width="150"> </el-table-column>
      <el-table-column prop="money" label="订单金额" width="150">
      </el-table-column>
      <el-table-column prop="address" label="交货地" width="150">
      </el-table-column>
      <el-table-column prop="MPQ" label="MPQ" width="150"> </el-table-column>
      <el-table-column prop="packing" label="包装" width="150">
      </el-table-column>
      <el-table-column prop="id" label="订单项" width="150"> </el-table-column>
      <el-table-column prop="desc" label="备注" width="150"> </el-table-column>
    </el-table>
    <el-pagination
      class="pagination"
      layout="total,sizes,prev, pager, next,jumper"
      :total="50"
    >
    </el-pagination>
  </div>
</template>

<script>
export default {
  name: "cusromTable",
  data() {
    return {
      tableData: [
        {
          waybillNo: "SF22020000295",
          status: "待收货",
          model: "H1",
          brand: "KEMET",
          number: "100",
          batch: "1",
          package: "XXXW95",
          currency: "人民币",
          price: "10",
          money: "10000",
          address: "国内",
          MPQ: "1",
          packing: "散装",
          id: "DD2202000295-001",
          desc: "",
        },
        {
          waybillNo: "SF22020000295",
          status: "部分收货",
          model: "H1",
          brand: "KEMET",
          number: "100",
          batch: "1",
          package: "XXXW95",
          currency: "人民币",
          price: "10",
          money: "10000",
          address: "国内",
          MPQ: "1",
          packing: "散装",
          id: "DD2202000295-001",
          desc: "",
        },
        {
          waybillNo: "SF22020000295",
          status: "已收货",
          model: "H1",
          brand: "KEMET",
          number: "100",
          batch: "1",
          package: "XXXW95",
          currency: "人民币",
          price: "10",
          money: "10000",
          address: "国内",
          MPQ: "1",
          packing: "散装",
          id: "DD2202000295-001",
          desc: "",
        },
      ],
    };
  },
  methods: {
    updateStatus() {
      this.tableData.map((item) => {
        if (item.status == "待收货") {
          Object.assign(item, { status: "已收货" });
          return item;
        }
      });
    },
  },
};
</script>

<style scoped lang="scss">
.custom-table {
  .pagination {
    margin-top: 10px;
    text-align: right;
  }
}
</style>